<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var \Magento\Customer\Block\Widget\Gender $block */
?>
<div class="field gender<?php if ($block->isRequired()) echo ' required' ?>">
    <label class="label" for="<?php echo $block->escapeHtmlAttr($block->getFieldId('gender')) ?>"><span><?php echo $block->escapeHtml(__('Gender')) ?></span></label>
    <div class="control">
        <select id="<?php echo $block->escapeHtmlAttr($block->getFieldId('gender')) ?>" name="<?php echo $block->escapeHtmlAttr($block->getFieldName('gender')) ?>" title="<?php echo $block->escapeHtmlAttr(__('Gender')) ?>"<?php if ($block->isRequired()):?> class="validate-select" data-validate="{required:true}"<?php endif; ?>>
            <?php $options = $block->getGenderOptions(); ?>
            <?php $value = $block->getGender();?>
            <?php foreach ($options as $option):?>
                <option value="<?php echo $block->escapeHtmlAttr($option->getValue()) ?>"<?php if ($option->getValue() == $value) echo ' selected="selected"' ?>><?php echo $block->escapeHtml(__($option->getLabel())) ?></option>
            <?php endforeach;?>
        </select>
    </div>
</div>
